package com.tracker.session;

import java.util.Set;

import com.tracker.bean.AccountUser;
import com.tracker.dao.AccountUserDAO;


public class AccountUserSession {
		private AccountUserDAO accountUserDAO = new AccountUserDAO();
		
        public void add(AccountUser accountUser) throws Exception{
        	accountUserDAO.persist(accountUser);
        }

        public Set<AccountUser> list() throws Exception{
        	return accountUserDAO.getListObject();
        }

        public AccountUser get(AccountUser accountUser) throws Exception{
        	return accountUserDAO.getObjectByKey(accountUser.getLogin());
        }

        public AccountUser getById(AccountUser accountUser) throws Exception{
        	return accountUserDAO.getObjectById(accountUser.getLogin());
        }

        public void delete(AccountUser accountUser) throws Exception{
        	accountUserDAO.delete(accountUser.getLogin());
        }
}

